package components;

public class Node extends Coordinate{

	private int line;
	private int id;
	private int four; //wczesniej bylo four z tad bledy
	
	public Node(){
		super();
		
		id=0;
		four=0;
	}
	
	public Node(int id, float longtitude, float lattitude, int four, int line){
		super(lattitude,longtitude);
		
		this.id = id;
		this.four = four;
		this.line = line;
	}
	
	public Node(int id, int longtitude, int lattitude, int four, int line){
		super(lattitude,longtitude);
		
		this.id = id;
		this.four = four;
		this.line = line;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public int getLine() {
		return line;
	}

	public void setLine(int line) {
		this.line = line;
	}

	public int getArcCount() {
		return four;
	}

	public void setArcCount(int four) {
		this.four = four;
	}
	
	public int getFour(){
		return four;
	}

	public void decrementArcs() {
		if(four > 0)
			four--;
	}
	
	public void decrementLine(){
		line--;
	}
	
	public String toString(){
		return fillTo(10,""+id)
				+fillTo(11,""+longtitude*1000*3600)
				+fillTo(11,""+lattitude*1000*3600)
				+fillTo(11,""+four);
	}
	
	private String fillTo(int fills, String text){
		String f = "";
		for(int i=0; i<fills-text.length(); i++){
			f += " ";
		}
		f += text;
		return f;
	}
	
}
